<admintpl file="header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="javascript:;">用户列表</a></li>
    </ul>

    <form class="well form-search" method="post" action="{:U('Member/lists')}" id="export_order">
        用户昵称：
        <input type="text" name="nickname" value="{$formget.nickname}" style="width: 100px;">
        用户账号：
        <input type="text" name="username" value="{$formget.username}" style="width: 100px;">
        注册时间：
        <input type='text' class="form-control js-date" value="{$formget.start_time}" name="start_time" style="width: 100px;"/>
        至
        <input type="text" class="js-date" name="end_time"  value="{$formget.end_time}" style="width: 100px;">

        <input type="submit" class="btn btn-primary" value="搜索"/>
    </form>

    <table style="margin-top: 10px;word-break:break-all;" class="table table-hover table-bordered table-list"
           id="menus-table">
        <thead>
        <tr>
            <th width="50">排序</th>
            <th width="50">ID</th>
            <th>账号</th>
            <th>昵称</th>
            <th>添加时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {$tablebody}
        </tbody>
    </table>
    <div class="pagination" >{$Page}</div>
</div>
<!--修改备注弹窗-->
<div>
<div class="modal fade" style="display: none;" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    拒绝理由
                </h4>
            </div>
            <form method="post" class="form-horizontal js-ajax-forms" action="{:U('Member/refuseAuth')}">
                <div class="modal-body">
                    <table>
                        <tbody>
                        <tr>
                            <td> 理由:</td>
                            <td><input type="text"  value="" name="content" placeholder=""> *</td>
                            <input name="id" class="hidden id" >
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="submit" class="btn btn-primary js-ajax-submit" >
                        提交
                    </button>
                </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
    <div>
    <div class="modal fade" style="display: none;" id="PushMsg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        定向推送
                    </h4>
                </div>
                <form method="post" class="form-horizontal js-ajax-forms" action="{:U('Member/PushMsg')}">
                    <div class="modal-body">
                        <table>
                            <tbody>
                            <tr>
                                <td> 内容:</td>
                                <td> <textarea cols="30" name="content"></textarea></td>
                                <!--<td><input type="text"  value="" name="content" placeholder=""> *</td>-->
                                <input name="id" class="hidden id" >
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                        </button>
                        <button type="submit" class="btn btn-primary js-ajax-submit" >
                            提交
                        </button>
                    </div>
                </form>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
    <script src="__PUBLIC__/js/jsshowloading.js"></script>
    <script>

        $('.hidden').hide();
        $('.add_ext').click(function () {
            var id = $(this).attr("name");
//            console.log(id);
            $(".id").val(id);
        });

        $('.push_msg').click(function () {
            var id = $(this).attr("name");
//            console.log(id);
            $(".id").val(id);
        });

        //导出数据
        $('.export_order').click(function () {
            var form_data = Array();
            form_data.order_sn = $("#export_order :input[name='username']").val();
            form_data.username = $("#export_order :input[name='nickname']").val();
            form_data.mem_auth = $("#export_order select").val();
            form_data.start_time = $("#export_order :input[name='start_time']").val();
            form_data.end_time = $("#export_order :input[name='end_time']").val();
////        console.log(form_data);

            $.ajax({

                url: "{:U('Member/export_member')}",
                dataType:"json",
                data:{nickname: form_data.nickname, username: form_data.username, mem_auth: form_data.mem_auth, start_time: form_data.start_time, end_time: form_data.end_time
                },
                type:'POST',
                async:true,
                beforeSend:function(){

//                $("body").showLoading();
                },//下面就是获取到的下载地址，直接通过document.location函数获取下载
                success:function(rst){
//                    console.log(rst);
                    if(rst.code == '210') {
                        alert(rst.msg);return;
                    }
                    $("body").hideLoading();
//                alert(rst.url);
                    document.location.href =(rst.url);

                },
                error: function(){
//                $("body").hideLoading();
                    alert("错误");
                },

            });
        });
    </script>

</body>
</html>